%% Plot for the IMPULSE Code
clc;clear;
%% Parameters
Lx = 256;
Ly = 16;

path = '../data/';%ref-8/
time = 10;
%% Options
% No.    1    2    3    4    5    6    7    8    9    10   11   12    13    14    15
name = {'ne','pe','ux','uy','uz','Ex','Ey','Ez','Bx','By','Bz','Bwx','Bwy','Bwz','Ions','ni'};
opt = 1;

%% Plot
switch opt
    case 1
        No = [1,2,3,6,7,8,9,10,11];
%          No = [1,3,6,7];
   No = [15];
        num = length(No);
        if(num~=0)
            for i=1:num
                if(No(i)==15)
                    datas = h5read([path,num2str(time),'.h5'],['/',name{No(i)}]);
                    figure;
                    plot(datas(3,:),datas(5,:),'.','MarkerSize',1);
                    title(name(No(i)));
%                     axis image;
%                     axis xy
                else
                    datas = h5read([path,num2str(time),'.h5'],['/',name{No(i)}]);
                    x = linspace(0,Lx,size(datas,1));
                    y = linspace(0,Ly,size(datas,2));
                    figure;
                    imagesc(x,y,datas');
                    title(name(No(i)));
                    axis image;
                    axis xy
                end
            end
        end
    case 2
        path1 = '../data/ref-22/';%ref-8/
        datas1 = h5read([path1,num2str(time),'.h5'],['/',name{6}]);
        x1 = linspace(0,Ly,size(datas1,1));
        path2 = '../data/ref-11/';%ref-8/
        datas2 = h5read([path2,num2str(time),'.h5'],['/',name{6}]);
        x2 = linspace(0,Ly,size(datas2,1));
        plot(x1,datas1(:,floor(end/2)));
        hold on;
        plot(x2,datas2(:,floor(end/2)))
end
%% EOF